package top.lishuoboy.hibernate.validator.a2_2;

import cn.hutool.core.lang.RegexPool;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import lombok.experimental.SuperBuilder;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
@Accessors(chain = true)
public class Person {
    @NotNull
    @Size(min = 2, max = 60)
    @Pattern(regexp = RegexPool.CHINESE_NAME)
    private String name;
}